<!--
 * @description  : 整改通知书展示项
 * @descriptionDetail: 整改通知书展示项
 * @copyright    : 浙江烟草
 * @author       : mwq
 * @create       : 2022-09-27 09:58:58
-->

<template>
  <view>
    <u-form :model="docInfo" ref="uForm" label-position="top">
      <view class="doc-head">
        {{ docInfo.fullDocNo }}
      </view>
      <u-form-item
        label="通知书名称"
        prop="excName"
      >
        <view>{{ docInfo.businessName }}</view>
      </u-form-item>
      <u-form-item
        label="整改单位"
        prop="receiveCompName"
      >
        <view>{{ docInfo.receiveCompName }}</view>
      </u-form-item>
      <u-form-item
        label="整改部门"
        prop="reformDptName"
      >
        <view>{{ docInfo.reformDptName }}</view>
      </u-form-item>
      <u-form-item
        label="下发日期"
        prop="reformIssuedDate"
      >
        <view>{{ docInfo.reformIssuedDate }}</view>
      </u-form-item> 
      <u-form-item
        label="整改类型"
        prop="reformTypeName"
      >
        <view>{{ docInfo.reformType | getDictName("I_REFORM_RECTIFICATION_TYPE",docInfo.reformType) }}</view>
      </u-form-item>
      <u-form-item
        label="简要概况"
        prop="majorProblem"
      >
        <u-input
          :disabled="isdisable"
          type="textarea"
          v-model="docInfo.majorProblem"
        />
      </u-form-item>
      <u-form-item
        label="内管部门整改意见"
        prop="reformIntDpt"
      >
        <u-input
          :disabled="isdisable"
          type="textarea"
          v-model="docInfo.reformIntDpt"
        />
      </u-form-item>
      <u-form-item
        label="附件信息"
      >
        <upload-images
          :url="uploadFile"
          :length="10"
          :extForm="{ fiGroupCode: 'zmng-images', bizId:documentDoc.docInsUuid }"
          :del-url="delUrl"
          :bizId="documentDoc.docInsUuid"
          :can-add="false"
          :can-del="false"
          :renderImages="renderImages"
          ref="saveModel3"
        >
        </upload-images>
      </u-form-item>
    </u-form>
  </view>
</template>

<script>
import store from '@/store';
import commonService from "@/service/internal/common.service";
import { UploadImages, } from "@/components";
export default {
  name: "MyExcHandle",
  components: {  UploadImages, },
  filters:{
    getDictName(value,dicName){
      if (!value) return ''
      if (!dicName) return ''
      return store.state.dicts[dicName].filter(d => d.bcbCode === value)[0].bcbName;
    },
  },
  props:{
    docIns:{
      type:Object,
      default:() => ({}),
    },
    documentDoc:{
      type:Object,
      default:() => ({}),
    },
  },
  data() {
    return {
      isdisable:true,
      docInfo: {},
      dtlList:{},
      uploadFile: commonService.uploadFile,
      delUrl: commonService.deleteFile,
    };
  },
  watch: {
    docIns: {
      immediate: true,
      handler(v) {
        console.log("文书信息", v);
        this.docInfo = {...v,};
        this.dtlList = this.docInfo;
      },
    },
    documentDoc:{
      immediate: true,
      handler(v) {
        console.log("byID", v);
      },
    },
  },
  methods: {
    handleSwitch(sw) {
      this.radioCheckWrap = sw;
    },
    renderImages(id) {
      return commonService.findFilesByBizId(id.bizId).then(r => {
        r.data.forEach(i => {
          i.src = `${commonService.downloadFile}?fileId=${i.gfiId}&tk=${uni.getStorageSync("tk")}`;
          i.filePath = i.src;
        });
        return r.data;
      });
    },
  },
};
</script>

<style lang="scss" scoped>
/deep/ .u-form-item--left__content__label {
  color: #666;
}
.doc-head {
  color: #191f25;
  font-weight: bold;
  font-size: 28rpx;
  text-align: center;
}
.unique-form /deep/ .u-form-item--right__content__slot {
  flex-direction:column
}
.unique-form /deep/.unique-textarea{
 width: 100%;
 height: 80rpx;
}
</style>